<div class="postbox">
	<div title="显示/隐藏" class="handlediv"><br></div>
	<h3 class="handle"><span>存储目录</span></h3>
	<div class="inside">
		<ul id="purpose_list" style="list-style-type:none;">
			<foreach name="purposes" var="item" key="key">
				<li><input type="radio" name="b_purpose" value="[$item.pp_id]" title="[$item.pp_title]"/><label class="pp_title">[$item.pp_title]</label><span id="[$item.pp_id]" class="delete_btn">X</span></li>
			</foreach>
		</ul>
		<p><input id="purpose_name" value=""><input type="button" id="add_purpose" value="添加"></p>
		<p>e.g /resads.61.com/pay。</p>
	</div>
</div>
<script>
	
	/*$(".handlediv").toggle(function(){
		$(".inside").slideUp(300);
	},function(){
		$(".inside").slideDown(300);
	});
	$("#add_purpose").click(function(){
		var $val = $("#purpose_name").val();
		if($val=="")
		{
			return false;
		}
		$.ajax({
			url:"/admin/admin_purpose/savepurpose",
			data:{pp_title:$val},
			success:function(data){
				$("#purpose_list").append('<li><input type="radio" name="b_purpose" value="'+data+'"/><label class="pp_title">'+$val+'</label><span id="[$item.pp_id]" class="delete_btn">X</span></li>');
				$("#purpose_name").val("");
			}
		});
		return false;
	});
	$(".pp_title").live('click',function(){
		var id = $(this).prev("[name=b_purpose]").val();
		var $this = $(this);
		var $txt = $this.html();
		$this.hide().after("<span class=modify_span><input class='modify_txt' value="+$txt+"><input type='button' value=修改 class='mbt'></span>");
		$(".mbt").click(function(){
			var v = $(this).prev(".modify_txt").val();
			$this.html(v);
			$.ajax({
				url:"/admin/admin_purpose/savepurpose",
				data:{pp_id:id,pp_title:v},
				success:function(data){
				}
			});
			$(this).parents(".modify_span").remove();
			$this.show();
		});
	});
	$(".delete_btn").live('click',function(){
		var id = $(this).attr("id");
		var self = $(this);
		if(confirm("确定要删除吗？"))
		{
			$.ajax({
				url:"/admin/admin_purpose/delpurposes",
				data:{item:id},
				dataType:"json",
				success:function(data){
					if(data.status)
					{
						self.parents("li").fadeOut(300,function(){self.parents("li").remove();});	
					}
				}
			});
		}
	});*/
</script>